/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package projecteuler;

import java.math.BigInteger;

/**
 *
 * @author ChunchO
 */
public class Problem016 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
		int sum = 0;
		String s = BigInteger.valueOf(2).pow(1000).toString();
		System.out.println( s.length());
		for(int i = 0;i<s.length();i++)
			sum += (((int)s.charAt(i))-((int)'0'));
		System.out.println( sum);
    }
}
